<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.json"};
  </script>

  <meta name="description" content="1.lwip源码获取 ​        http:&#x2F;&#x2F;download-mirror.savannah.gnu.org&#x2F;releases&#x2F;lwip&#x2F;，下载两个包：lwip-2.1.3.zip（源码包）和 contrib-2.1.0.zip（contrib 包），contrib包里面装的是移植和应用lwip的一些应用示例。 2.源码添加 ​        将lwip源码包中src目录下的文件都加到自">
<meta property="og:type" content="article">
<meta property="og:title" content="stm32f407裸机移植lwip2.1.3">
<meta property="og:url" content="http://example.com/2022/09/25/stm32f407%E8%A3%B8%E6%9C%BA%E7%A7%BB%E6%A4%8Dlwip2.1.3/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="1.lwip源码获取 ​        http:&#x2F;&#x2F;download-mirror.savannah.gnu.org&#x2F;releases&#x2F;lwip&#x2F;，下载两个包：lwip-2.1.3.zip（源码包）和 contrib-2.1.0.zip（contrib 包），contrib包里面装的是移植和应用lwip的一些应用示例。 2.源码添加 ​        将lwip源码包中src目录下的文件都加到自">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251504210.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251510419.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251514924.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251528264.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251532096.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251536837.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251540381.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251543586.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251544433.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251553970.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251639226.png">
<meta property="article:published_time" content="2022-09-25T13:12:47.000Z">
<meta property="article:modified_time" content="2022-09-25T13:12:47.000Z">
<meta property="article:author" content="xudonglei">
<meta property="article:tag" content="lwip">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251504210.png">

<link rel="canonical" href="http://example.com/2022/09/25/stm32f407%E8%A3%B8%E6%9C%BA%E7%A7%BB%E6%A4%8Dlwip2.1.3/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>stm32f407裸机移植lwip2.1.3 | 学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Do not bb, show me the example</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/09/25/stm32f407%E8%A3%B8%E6%9C%BA%E7%A7%BB%E6%A4%8Dlwip2.1.3/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          stm32f407裸机移植lwip2.1.3
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-09-25 21:12:47" itemprop="dateCreated datePublished" datetime="2022-09-25T21:12:47+08:00">2022-09-25</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2022/09/25/stm32f407%E8%A3%B8%E6%9C%BA%E7%A7%BB%E6%A4%8Dlwip2.1.3/" class="post-meta-item leancloud_visitors" data-flag-title="stm32f407裸机移植lwip2.1.3" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/09/25/stm32f407%E8%A3%B8%E6%9C%BA%E7%A7%BB%E6%A4%8Dlwip2.1.3/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/09/25/stm32f407%E8%A3%B8%E6%9C%BA%E7%A7%BB%E6%A4%8Dlwip2.1.3/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p><strong>1.lwip源码获取</strong></p>
<p>​        <a target="_blank" rel="noopener" href="http://download-mirror.savannah.gnu.org/releases/lwip/%EF%BC%8C%E4%B8%8B%E8%BD%BD%E4%B8%A4%E4%B8%AA%E5%8C%85%EF%BC%9Alwip-2.1.3.zip%EF%BC%88%E6%BA%90%E7%A0%81%E5%8C%85%EF%BC%89%E5%92%8C">http://download-mirror.savannah.gnu.org/releases/lwip/，下载两个包：lwip-2.1.3.zip（源码包）和</a> contrib-2.1.0.zip（contrib 包），contrib包里面装的是移植和应用lwip的一些应用示例。</p>
<p><strong>2.源码添加</strong></p>
<p>​        将lwip源码包中src目录下的文件都加到自己的keil工程里。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251504210.png" style="zoom:67%;">

<p>​        根据这些源码的功能，分组添加到keil工程里。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251510419.png" style="zoom:67%;">

<p>同时工程中添加lwip头文件路径：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251514924.png" style="zoom:67%;">

<p><strong>3.移植头文件</strong></p>
<p>​        lwip需要一些头文件的支持，比如 lwipopts.h、cc.h、pref.h 等。lwipopts.h 就是用于配置 LwIP 的相关参数的，一般来说LwIP 默认会有参数的配置，存放在 opt.h 文件中，如果用户没有在 lwipopts.h 文件进行配置，那么 LwIP 就会使用 opt.h 默认的参数。</p>
<p>​        这些头文件例子可以在contrib包中找到参考，我们在App文件夹下新建目录arch，用来存放这些文件，我们直接从其他工程中拿过来先用。</p>
<p><strong>4.移植源文件</strong></p>
<p>​        移植源文件主要是移植网卡的驱动，ethernetif.c 文件就是存放这些函数的，LwIP 的 contrib 包中就包含这个文件的模板，我们直接拿过来修改即可。LAN8720A网卡的驱动我们也不会写呀，怎么办？可以直接用cubemx来生成。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251528264.png" style="zoom:67%;">

<p>配置PHY地址为0，LAN8720A第10脚悬空时地址就为0。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251532096.png" style="zoom:67%;">

<p> PHY选择userPHY ,A用系统自带的。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251536837.png" style="zoom:67%;">

<p>PHY参数设置由来：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251540381.png" style="zoom:67%;">

<p>其余的一些配置：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251543586.png" style="zoom:67%;">

<p>使能lwIP并开启静态IP模式：</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251544433.png" style="zoom:67%;">

<p>然后生成工程即可。</p>
<p><strong>5.从生成的工程中挑选有用代码</strong></p>
<p>​        到stm32f4xx_hal_conf.h文件中将Ethernet peripheral configuration相关的配置以及宏定义拷贝到自己的工程中。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251553970.png" style="zoom:67%;">

<p>​        自己新建一个.c文件，用来存放lan8720a的初始化等驱动。先将cubemx生成的ethernetif.c文件中的代码拷贝一些过来，下图是部分代码。</p>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/202209251639226.png" style="zoom:67%;">

<p>然后cubemx生成的ethernetif.c文件中的代码部分直接拷贝到自己的ethernetif.c文件中。</p>
<p><strong>6.应用程序编写</strong></p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">netif</span> <span class="title">gnetif</span>;</span></span><br><span class="line"><span class="keyword">ip4_addr_t</span> ipaddr;</span><br><span class="line"><span class="keyword">ip4_addr_t</span> netmask;</span><br><span class="line"><span class="keyword">ip4_addr_t</span> gw;</span><br><span class="line"><span class="keyword">uint8_t</span> IP_ADDRESS[<span class="number">4</span>];</span><br><span class="line"><span class="keyword">uint8_t</span> NETMASK_ADDRESS[<span class="number">4</span>];</span><br><span class="line"><span class="keyword">uint8_t</span> GATEWAY_ADDRESS[<span class="number">4</span>];</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">  * LwIP initialization function</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">MX_LWIP_Init</span><span class="params">(<span class="keyword">void</span>)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">  <span class="comment">/* IP addresses initialization */</span></span><br><span class="line">  IP_ADDRESS[<span class="number">0</span>] = <span class="number">192</span>;</span><br><span class="line">  IP_ADDRESS[<span class="number">1</span>] = <span class="number">168</span>;</span><br><span class="line">  IP_ADDRESS[<span class="number">2</span>] = <span class="number">1</span>;</span><br><span class="line">  IP_ADDRESS[<span class="number">3</span>] = <span class="number">100</span>;</span><br><span class="line">  NETMASK_ADDRESS[<span class="number">0</span>] = <span class="number">255</span>;</span><br><span class="line">  NETMASK_ADDRESS[<span class="number">1</span>] = <span class="number">255</span>;</span><br><span class="line">  NETMASK_ADDRESS[<span class="number">2</span>] = <span class="number">255</span>;</span><br><span class="line">  NETMASK_ADDRESS[<span class="number">3</span>] = <span class="number">0</span>;</span><br><span class="line">  GATEWAY_ADDRESS[<span class="number">0</span>] = <span class="number">192</span>;</span><br><span class="line">  GATEWAY_ADDRESS[<span class="number">1</span>] = <span class="number">168</span>;</span><br><span class="line">  GATEWAY_ADDRESS[<span class="number">2</span>] = <span class="number">1</span>;</span><br><span class="line">  GATEWAY_ADDRESS[<span class="number">3</span>] = <span class="number">1</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">/* USER CODE BEGIN IP_ADDRESSES */</span></span><br><span class="line"><span class="comment">/* USER CODE END IP_ADDRESSES */</span></span><br><span class="line"></span><br><span class="line">  <span class="comment">/* Initilialize the LwIP stack without RTOS */</span></span><br><span class="line">  lwip_init();</span><br><span class="line"></span><br><span class="line">  <span class="comment">/* IP addresses initialization without DHCP (IPv4) */</span></span><br><span class="line">  IP4_ADDR(&amp;ipaddr, IP_ADDRESS[<span class="number">0</span>], IP_ADDRESS[<span class="number">1</span>], IP_ADDRESS[<span class="number">2</span>], IP_ADDRESS[<span class="number">3</span>]);</span><br><span class="line">  IP4_ADDR(&amp;netmask, NETMASK_ADDRESS[<span class="number">0</span>], NETMASK_ADDRESS[<span class="number">1</span>] , NETMASK_ADDRESS[<span class="number">2</span>], NETMASK_ADDRESS[<span class="number">3</span>]);</span><br><span class="line">  IP4_ADDR(&amp;gw, GATEWAY_ADDRESS[<span class="number">0</span>], GATEWAY_ADDRESS[<span class="number">1</span>], GATEWAY_ADDRESS[<span class="number">2</span>], GATEWAY_ADDRESS[<span class="number">3</span>]);</span><br><span class="line"></span><br><span class="line">  <span class="comment">/* add the network interface (IPv4/IPv6) without RTOS */</span></span><br><span class="line">  netif_add(&amp;gnetif, &amp;ipaddr, &amp;netmask, &amp;gw, <span class="literal">NULL</span>, &amp;ethernetif_init, &amp;ethernet_input);</span><br><span class="line"></span><br><span class="line">  <span class="comment">/* Registers the default network interface */</span></span><br><span class="line">  netif_set_default(&amp;gnetif);</span><br><span class="line"></span><br><span class="line">  <span class="keyword">if</span> (netif_is_link_up(&amp;gnetif))</span><br><span class="line">  &#123;</span><br><span class="line">    <span class="comment">/* When the netif is fully configured this function must be called */</span></span><br><span class="line">    netif_set_up(&amp;gnetif);</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="keyword">else</span></span><br><span class="line">  &#123;</span><br><span class="line">    <span class="comment">/* When the netif link is down this function must be called */</span></span><br><span class="line">    netif_set_down(&amp;gnetif);</span><br><span class="line">  &#125;</span><br><span class="line"></span><br><span class="line">  <span class="comment">/* Set the link callback function, this function is called on change of link status*/</span></span><br><span class="line">  netif_set_link_callback(&amp;gnetif, ethernetif_update_config);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">void</span>)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">  HAL_Init();</span><br><span class="line">  SystemClock_Config();</span><br><span class="line"></span><br><span class="line">	LED_Init();</span><br><span class="line">	UART_Init();</span><br><span class="line">	MX_LWIP_Init();</span><br><span class="line"> </span><br><span class="line">  <span class="keyword">while</span> (<span class="number">1</span>)</span><br><span class="line">  &#123;</span><br><span class="line">			<span class="comment">/*</span></span><br><span class="line"><span class="comment">			printf(&quot;hello\r\n&quot;);</span></span><br><span class="line"><span class="comment">			LED0_Toggle();</span></span><br><span class="line"><span class="comment">			HAL_Delay(1000);</span></span><br><span class="line"><span class="comment">		  */</span></span><br><span class="line">			ethernetif_input(&amp;gnetif);</span><br><span class="line">		  sys_check_timeouts();</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>代码编译后烧录，电脑端可以ping通开发板，结束！</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/lwip/" rel="tag"># lwip</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2022/09/20/%E6%9D%B0%E7%90%86MCU%E5%BC%80%E5%8F%91/" rel="prev" title="杰理MCU开发">
      <i class="fa fa-chevron-left"></i> 杰理MCU开发
    </a></div>
      <div class="post-nav-item">
    <a href="/2022/10/02/stm32f4%E7%BD%91%E7%BB%9CDMA%E6%8F%8F%E8%BF%B0%E7%AC%A6/" rel="next" title="stm32f4网络DMA描述符">
      stm32f4网络DMA描述符 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">xudonglei</p>
  <div class="site-description" itemprop="description">搬砖 嵌入式</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">283</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">67</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xudonglei</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'BT0Qw9HcTpPv1a6cT1iDBXKz-gzGzoHsz',
      appKey     : 'LMCMh8v02JTMFAwKNRcgoizI',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
